<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
		.box1{
			position: relative;
		     Width: 400px;
		     Height: 400px;
		     Background-color: pink;
		     margin: 0 auto;
		}
		.box2{
		     Width: 100px;
		     Height: 100px;
			 line-height: 100px;
		     Background-color: green;
			 position: absolute;
			 margin:  auto;
			 top: 0;
			 right: 0;
			 bottom: 0;
			 left: 0;
		}
		</style>

	</head>
	<body>
		<div class="box1">
		 <div class="box2">
		   <span>文本</span>
		 </div>  
		</div>
		 

	</body>
</html>
